package plus.easydo.starter.lock.annotation;

import org.springframework.context.annotation.Import;
import plus.easydo.starter.lock.aspect.RedissonLockAspect;
import plus.easydo.starter.lock.aspect.RedissonRedLockAspect;
import plus.easydo.starter.lock.configure.CustomizeRedissonAutoConfig;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 开启redisson集群
 * @author yuzhanfeng
 */
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Import({CustomizeRedissonAutoConfig.class, RedissonLockAspect.class, RedissonRedLockAspect.class})
public @interface EnableRedisson {

    /**
     * 单机模式
     */
    boolean standalone() default false;

    /**
     * 集群模式
     */
    boolean cluster() default false;

    /**
     * 哨兵模式
     */
    boolean sentinel() default false;

    /**
     * 单机
     */
    String STANDALONE = "standalone";

    /**
     * 集群
     */
    String CLUSTER = "cluster";

    /**
     * 哨兵
     */
    String SENTINEL = "sentinel";
}
